﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RpgLibrary.SpellClasses
{
    public enum SpellType { Passive, Sustained, Activated }

    public class SpellData : IRpgDataObject
    {
        #region Field Region

        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        public string[] AllowedClasses;
        public Dictionary<string, int> AttributeRequirements;
        public string[] SpellPrerequisites;
        public int LevelRequirement;
        public SpellType SpellType;
        public int ActivationCost;
        public string[] Effects;

        #endregion

        #region Property Region
        #endregion

        #region Constructor Region

        public SpellData()
        {
            AttributeRequirements = new Dictionary<string, int>();
        }

        #endregion
        
        #region Method Region
        #endregion
        
        #region Virtual Method region
        
        public override string ToString()
        {
            string toString = Name;
            foreach (string s in AllowedClasses)
                toString += ", " + s;
            foreach (string s in AttributeRequirements.Keys)
                toString += ", " + s + "+" + AttributeRequirements[s].ToString();
            foreach (string s in SpellPrerequisites)
                toString += ", " + s;
            toString += ", " + LevelRequirement.ToString();
            toString += ", " + SpellType.ToString();
            toString += ", " + ActivationCost.ToString();
            foreach (string s in Effects)
                toString += ", " + s;
            return toString;
        }
        
        #endregion
    }
}
